package com.ch3cooh.consumer2.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class TopicConsumer {

    @RabbitListener(queues = "topic.message")    //监听器监听指定的Queue
    public void message(String msg) {
        System.out.println("message: " + msg);
    }

    @RabbitListener(queues="topic.messages")    //监听器监听指定的Queue
    public void messages(String msg){
        System.out.println("messages: " + msg);
    }
}
